package com.atchangsha.system.controller;

import com.atchangsha.system.common.utils.Result;
import com.atchangsha.system.dto.LoginDto;
import com.atchangsha.system.dto.WorkerLoginDto;
import com.atchangsha.system.service.LoginService;
import com.atchangsha.system.service.WorkerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 登录
 */
@RestController
@RequestMapping("system")
public class LoginController {
    @Resource
    private LoginService loginService;

    /**
     * 登录
     * @param loginDto
     * @return
     */
    @PostMapping("/login")
    public Result login(@RequestBody LoginDto loginDto){
        return loginService.login(loginDto);
    }
}
